load("//bazel:tachyon_cc.bzl", "tachyon_cc_library", "tachyon_cc_unittest")

package(default_visibility = ["//visibility:public"])

tachyon_cc_library(
    name = "challenger",
    hdrs = ["challenger.h"],
    deps = [
        ":challenger_traits_forward",
        "//tachyon/base:logging",
        "//tachyon/base:parallelize",
        "//tachyon/base:profiler",
        "//tachyon/base:range",
        "//tachyon/base/containers:container_util",
    ],
)

tachyon_cc_library(
    name = "challenger_traits_forward",
    hdrs = ["challenger_traits_forward.h"],
)

tachyon_cc_library(
    name = "duplex_challenger",
    hdrs = ["duplex_challenger.h"],
    deps = [
        ":challenger",
        "//tachyon/crypto/hashes/sponge:sponge_state",
        "@com_google_absl//absl/container:inlined_vector",
    ],
)

tachyon_cc_library(
    name = "hash_challenger",
    hdrs = ["hash_challenger.h"],
    deps = [
        ":challenger",
        "//tachyon/base/containers:container_util",
    ],
)

tachyon_cc_library(
    name = "multi_field32_challenger",
    hdrs = ["multi_field32_challenger.h"],
    deps = [
        ":challenger",
        ":multi_field32_conversions",
        "//tachyon/base/containers:container_util",
        "//tachyon/crypto/hashes/sponge:sponge_state",
        "@com_google_absl//absl/container:inlined_vector",
    ],
)

tachyon_cc_library(
    name = "multi_field32_conversions",
    hdrs = ["multi_field32_conversions.h"],
    deps = [
        "//tachyon/base/containers:adapters",
        "//tachyon/build:build_config",
        "@com_google_absl//absl/types:span",
    ],
)

tachyon_cc_unittest(
    name = "challenger_unittests",
    srcs = [
        "duplex_challenger_unittest.cc",
        "hash_challenger_unittest.cc",
        "multi_field32_challenger_unittest.cc",
    ],
    deps = [
        ":duplex_challenger",
        ":hash_challenger",
        ":multi_field32_challenger",
        "//tachyon/crypto/hashes/sponge:padding_free_sponge",
        "//tachyon/crypto/hashes/sponge/poseidon2",
        "//tachyon/crypto/hashes/sponge/poseidon2:poseidon2_params",
        "//tachyon/crypto/hashes/sponge/poseidon2/param_traits:poseidon2_baby_bear",
        "//tachyon/crypto/hashes/sponge/poseidon2/param_traits:poseidon2_bn254",
        "//tachyon/math/finite_fields/test:finite_field_test",
    ],
)
